#include <iostream>
using namespace std;

#include "main.h"

int main(int argc, char **argv)
{
	int array[] = {9, 8, 4, 2, 10, -1};
	int len = sizeof(array) / sizeof(int);
	int k = 5;
	int res = 0;
	
//-------------------------------------------------------
// Find Kth smallest element ( k starts from 0 )

	res = randomizedSelect(array, 0, len-1, k);
	
//--------------------------------------------------------

	cout << "The " << k << "th smallest element is " << res << endl;
	
	cin.get();
	return 0;
}
